window.onload = function(){
    var url = "http://localhost:3000/top/album";
    
    $.ajax({
        method:"get",
        url:url,
        success:function(item){
            // console.log(item.albums);
            item.albums.forEach(element => {
                var {picUrl,artist,name}=element;
                var singer = artist.name;
                var html =`<div class="song">
                                <img class="songImg" src=${picUrl} alt="">
                                <p class="songTitle">${name}</p>
                                <p class="songer">${singer}</p>
                            </div>`
                $(".musicList").append(html);
            });
        }
    })
}